using System.Collections;
using System.Collections.Generic;
using QFramework;
using UnityEngine;


namespace AsterroidX
{
    public enum PowerType
    { 
        None=0,
        PowerUpGhost,
        PowerUpSpread,
        PowerUpCircle,
        PowerUpDuration,
        PowerUpRepetScreen,
        PowerUpBigBullet,
        PowerUpDamageUp,
        PowerUpRotatePlayer,
        PowerUpTornado,
        PowerUpUFO,
        PowerUpCobra,
        PowerUpFullScreen,
        PowerUpRasengan

    }

    [ViewControllerChild]
    public abstract class PowerUp : ViewController,IController
    {
        public abstract Rigidbody2D GetRigidbody2D {  get; }


        public abstract PowerType PowerType { get; }


        private GameModel mGameModel;

        private Vector2 mDirection;

        public IArchitecture GetArchitecture()
        {
            return GameApp.Interface;
        }

      
        void Start()
        {
            mDirection = -transform.Position().normalized;
            mGameModel=this.GetModel<GameModel>();
          
        }

        private void FixedUpdate()
        {
            if(!mGameModel.GameRunning)
            {
                GetRigidbody2D.velocity = Vector2.zero;
                return;
            }
            GetRigidbody2D.velocity = mDirection;
        }

        

        void Update()
        {
            if (ScreenHelper.OutScreen(transform, 1f, 1f))
            {
                this.DestroyGameObj();
            }
        }

       
    }

}

